package com.sugon.service.impl;

import cn.hutool.core.util.RandomUtil;
import com.sugon.dao.ModuleTimesRecordProdDao;
import com.sugon.entity.ModuleTimesRecordProdEntity;
import com.sugon.service.ModuleTimesRecordProdService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * 模次每日同步记录，从MODULE_TIMES_RECORD清洗而来Service实现类
 *
 * @author sugon
 * @date 2021-12-16 10:19:11
 */
@Service("moduleTimesRecordProdService")
public class ModuleTimesRecordProdServiceImpl implements ModuleTimesRecordProdService {
    @Autowired
    private ModuleTimesRecordProdDao moduleTimesRecordProdDao;

    @Override
    public ModuleTimesRecordProdEntity queryObject(String id) {
        return moduleTimesRecordProdDao.queryObject(id);
    }

    @Override
    public List<ModuleTimesRecordProdEntity> queryList(Map<String, Object> map) {
        return moduleTimesRecordProdDao.queryList(map);
    }

    @Override
    public int queryTotal(Map<String, Object> map) {
        return moduleTimesRecordProdDao.queryTotal(map);
    }

    @Override
    public int save(ModuleTimesRecordProdEntity moduleTimesRecordProd) {
        moduleTimesRecordProd.setId(RandomUtil.randomString(32));
        return moduleTimesRecordProdDao.save(moduleTimesRecordProd);
    }

    @Override
    public int update(ModuleTimesRecordProdEntity moduleTimesRecordProd) {
        return moduleTimesRecordProdDao.update(moduleTimesRecordProd);
    }

    @Override
    public int delete(String id) {
        return moduleTimesRecordProdDao.delete(id);
    }

    @Override
    public int deleteBatch(String[] ids) {
        return moduleTimesRecordProdDao.deleteBatch(ids);
    }
}
